home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 19 / CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso / CUCD / Readers / Gui4Cli / Docs / Tutorials / TextIn.gc < prev    next >
Text File  |  1997-12-02  |  2KB  |  53 lines

  1. G4C
  2.  
  3. WinBig -1 -1 350 100 "TextIn.gc"
  4. WinType 11110001
  5. usetopaz
  6.  
  7. BOX 0 0 0 0 OUT RIDGE
  8.  
  9. xonLoad 
  10. GuiOpen TextIn.gc
  11. setgad textin.gc 1 on  ; enable the 1st xtextin gadget when window opens
  12.                        ; Not needed, but makes it easier for the user.. 
  13.  
  14. xonClose
  15. GuiQuit TextIn.gc
  16.  
  17. Text 140 2 100 12 'TextIn' 6 NOBOX               ;  Headings
  18. Text 10 12 100 12 'Enter your ..' 14 NOBOX
  19.  
  20. ; ---- Arguments required for a TextIn command :
  21. ;      ST = StartingText  BufL = BufferLength 
  22. ;      Note that the 'Title' appears outside the box, and is really a
  23. ;      label, unlike xButton, in which 'Title' appears IN the box.
  24.  
  25. ;        L   T  W   H     Title    Var  ST BufL
  26. ;        |   |  |   |       |       |   |  |
  27. xTextIn 100 30 200 14 'First name' nam1 '' 32
  28. gadid 1
  29. setgad textin.gc 2 on    ; we do this to enable the next gadget as soon
  30.                          ; as <enter> is pressed on this one..
  31.  
  32.  
  33. xTextIn 100 50 200 14 'Surname' nam2 '' 32
  34. gadid 2
  35. ; The following indented lines are all carried out as soon as you
  36. ; press <Return> after entering a surname.
  37.  
  38.    ; ---- Arranging the two names to follow the greeting
  39.    appvar nam1 ' '                      ;  Append a space
  40.    appvar nam1 $nam2                    ;  Append the second name
  41.    ;      The variable nam1 now contains nam1 and nam2 
  42.             
  43.    setvar Greeting 'Hi there, '         ;  Set the greeting
  44.    appvar Greeting $nam1                ;  Append the names
  45.    Update TextIn.gc 3 $Greeting         ;  Update the text
  46.  
  47.  
  48. ; -------- A text gadget to hold the output
  49. Text 10 70 300 14 '' 128 NOBOX
  50. Gadid 3
  51.  
  52.  
  53.